﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MongoServices
{
	/// <summary>
	/// This attribute is to be applied the models with your application and defines the name of the mongoDB collection to be used.
	/// </summary>
	/// <remarks>If the repository cannot find this attribute a <see cref="MongoCollectionNameMissingException"/> will be thrown.</remarks>
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	public sealed class MongoCollectionNameAttribute : Attribute
	{
		#region Public Properties
		/// <summary>
		/// Gets the name of the mongoDB collection for the <see cref="MongoServicesModel"/>.
		/// </summary>
		public string CollectionName { get; private set; }
		#endregion

		#region Public Constructors
		/// <summary>
		/// Constructs a new MongoCollectionNameAttribute based on the <c>collectionName</c> parameter.
		/// </summary>
		/// <param name="collectionName">The name of the mongoDB collection.</param>
		public MongoCollectionNameAttribute(string collectionName)
		{
			CollectionName = collectionName;
		}
		#endregion
	}
}
